package com.hgyc.mom.common.enums;

/**
 * 消息编码
 * @author fengwj
 * @date 2019-12-13 11:00
 */
public enum CodeMsg {

    SUCCESS(200,"请求成功"),

    LOGIN_ERROR(401,"登录超时"),

    ERROR(500, "运行异常"),

    /**
     * 同一个接口请求频发
     */
    ACCESS_LIMIT_REACHED(501,"请求频发，请稍后再试"),

    /**
     * 数据存在异常编码
     */
    ENTITY_EXIST(502,"数据重复"),

    PARAM_FAIL(503,"方法参数错误"),

    VALIDATION_FAIL(504, "校验错误"),

    SAVE_FAIL(505, "保存异常"),

    JSON_PARSE_FAIL(506, "参数解析错误"),

    REQUEST_METHOD_ERROR(507, "请求方法错误"),

    NOT_NULL(508, "不能为空"),

    FLOW_ERROR(509, "流程异常"),

    JOB_ERROR(510, "定义任务异常"),

    WARNING(999, "异常警告")
    ;

    private Integer code;

    private String msg;

    CodeMsg(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
